<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
初始化系统管理<br/>
<ul id="files">
</ul>
<a href="#" onclick="importact('importiplocation','')">importiplocation</a></br>
<script src="scripts/jquery-2.0.0.min.js"></script/>
<script>
function importact(cat,file){
  console.log(file);
  $.post('setup',{cat:cat,file:file}).success(function(ret){
    console.log(ret);
  })
}

function importyaml(file){
  console.log(file);
  importact('importyaml',file);
}
$(document).ready(function(){

  $.get('setup').success(function(ret){
    console.log(ret);
    $(JSON.parse(ret)).each(function(i,o){
      console.log(i+','+o);
      $('#files').append($(['<li>',o,'<a href=# onclick=importyaml(\'',o,'\')>import</a>','</li>'].join('')));
    });
  });

});
</script>
</body>
</html>
